// signal_demo.c
#include <stdio.h>
#include <signal.h>
#include <unistd.h>

void sigHandler(int signum) {
    printf("Received signal: %d\n", signum);
}

int main() {
    signal(SIGINT, sigHandler); // 注册SIGINT信号处理函数
    while (1) {
        sleep(1);
    }
    return 0;
}
